import { createRouter, createWebHistory } from 'vue-router';
import IndexView from '../views/index.vue';
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: () => import('@/views/login.vue'),
      meta: {
        title: '登录',
      },
    },
    {
      path: '/index',
      name: 'IndexView',
      component: () => import('@/views/index.vue'),
      meta: {
        title: '',
      },
      children: [
        {
          path: 'task',
          name: 'task',
          meta: {
            title: '作业核查',
          },
          children: [
            {
              path: 'work-distribution',
              name: 'work-distribution',
              meta: {
                title: '任务分发',
              },
              component: () => import('@/views/task/task-distribution.vue'),
            },
            {
              path: 'task-verify-progress',
              name: 'task-verify-progress',
              meta: {
                title: '核查进度',
              },
              component: () => import('@/views/task/verify-progress.vue'),
            },
            {
              path: 'task-todo-box',
              name: 'task-todo-box',
              meta: {
                title: '待办箱',
              },
              component: () => import('@/views/task/todo-box.vue'),
            },
            {
              path: 'box-processed',
              name: 'box-processed',
              meta: {
                title: '已办箱',
              },
              component: () => import('@/views/task/box-processed.vue'),
            },
          ],
        },
        {
          path: 'supervision',
          name: 'supervision',
          meta: {
            title: '监理核查',
          },
          children: [
            {
              path: 'supervision-task-distribution',
              name: 'supervision-task-distribution',
              meta: {
                title: '任务分发',
              },
              component: () =>
                import('@/views/supervision/task-distribution.vue'),
            },
            {
              path: 'supervision-verify-progress',
              name: 'supervision-verify-progress',
              meta: {
                title: '核查进度',
              },
              component: () =>
                import('@/views/supervision/verify-progress.vue'),
            },
            {
              path: 'supervision-todo-box',
              name: 'supervision-todo-box',
              meta: {
                title: '待办箱',
              },
              component: () => import('@/views/supervision/todo-box.vue'),
            },
            {
              path: 'supervision-box-processed',
              name: 'supervision-box-processed',
              meta: {
                title: '已办箱',
              },
              component: () => import('@/views/supervision/box-processed.vue'),
            },
          ],
        },
        {
          path: 'supervision-confirm',
          name: 'supervision-confirm',
          meta: {
            title: '监理确认',
          },
          children: [
            {
              path: 'supervision-confirm-task-distribution',
              name: 'supervision-confirm-task-distribution',
              meta: {
                title: '任务分发',
              },
              component: () =>
                import('@/views/supervision-confirm/task-distribution.vue'),
            },
            {
              path: 'supervision-confirm-verify-progress',
              name: 'supervision-confirm-verify-progress',
              meta: {
                title: '核查进度',
              },
              component: () =>
                import('@/views/supervision-confirm/verify-progress.vue'),
            },
            {
              path: 'supervision-confirm-todo-box',
              name: 'supervision-confirm-todo-box',
              meta: {
                title: '待办箱',
              },
              component: () =>
                import('@/views/supervision-confirm/todo-box.vue'),
            },
            {
              path: 'supervision-confirm-box-processed',
              name: 'supervision-confirm-box-processed',
              meta: {
                title: '已办箱',
              },
              component: () =>
                import('@/views/supervision-confirm/box-processed.vue'),
            },
          ],
        },
        {
          path: 'supervision-again',
          name: 'supervision-again',
          meta: {
            title: '再监理核查',
          },
          children: [
            {
              path: 'supervision-again-task-distribution',
              name: 'supervision-again-task-distribution',
              meta: {
                title: '任务分发',
              },
              component: () =>
                import('@/views/supervision-again/task-distribution.vue'),
            },
            {
              path: 'supervision-again-todo-box',
              name: 'supervision-again-todo-box',
              meta: {
                title: '待办箱',
              },
              component: () => import('@/views/supervision-again/todo-box.vue'),
            },
            {
              path: 'supervision-again-box-processed',
              name: 'supervision-again-box-processed',
              meta: {
                title: '已办箱',
              },
              component: () =>
                import('@/views/supervision-again/box-processed.vue'),
            },
          ],
        },
        {
          path: 'audit-statistics',
          name: 'audit-statistics',
          meta: {
            title: '审核统计',
          },
          children: [
            {
              path: 'operator-verification',
              name: 'operator-verification',
              meta: {
                title: '作业员核查',
              },
              component: () =>
                import('@/views/audit-statistics/operator-verification.vue'),
            },
            {
              path: 'supervision-verification',
              name: 'supervision-verification',
              meta: {
                title: '待办箱',
              },
              component: () =>
                import('@/views/audit-statistics/supervision-verification.vue'),
            },
          ],
        },
      ],
    },
  ],
});

export default router;
